using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;

public class HoudiniCloudsRenderFeature : ScriptableRendererFeature
{
    private HoudiniCloudsRenderPass _cloudsPass;
    private Material _cloudMat;
    // private HoudiniCloudsShadowRenderPass _shadowPass;
    // private Material _shadowMat;

    public override void Create()
    {
        _cloudsPass = new HoudiniCloudsRenderPass();
        // _shadowPass = new HoudiniCloudsShadowRenderPass(_shadowMat)
        // {
        //     renderPassEvent = RenderPassEvent.BeforeRenderingPostProcessing
        // };
    }

    public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
    {
        // if (renderingData.cameraData.camera.CompareTag("ShadowCamera"))
        // {
        //     _shadowPass.Setup(renderer.cameraColorTarget);
        //     renderer.EnqueuePass(_shadowPass);
        //     return;
        // }
        // var cam = renderingData.cameraData.camera;
        // if (cam.CompareTag("MainCamera") || cam==Camera.current)
        if (VolumeManager.instance.stack.GetComponent<HoudiniCloudsVolume>().IsActive())
            renderer.EnqueuePass(_cloudsPass); 
    }
}